/*======================================================================================================================================================================

       MES全局功能函数   by:haile 
       create:2017-10-10
 
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 		2017-10-10  +  draw_tray256() -------------------------------绘画256电池托盘

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

=======================================================================================================================================================================*/



/*=====绘画256电池托盘======================================================================================

container: 容器dom ID

*/
 
function draw_tray256(container)
{
	var rowDom=$("<div></div>");
    for(var i=1;i<=16;i++)
	{
	   var dom=$("<div>"+i+"</div>");
	   dom.css({"float":"left","width":"6.25%","height":"18px","font-weight":"bold","text-align":"center"});
	   rowDom.append(dom);
	}
	$("#"+container).append(rowDom);
    rowDom=$("<div style='position:relative;clear:both'></div>");
    for(var i=0;i<256;i++)
	{
		var row=i/16+1;
		var dom;
		if(i%16==15)
	   {
                dom=$("<div>"+String.fromCharCode(64+row)+"</div>");
		        dom.css({"position":"absolute","line-height":"3","right":"-38px","top":"4px","width":"32px","height":"18px","font-weight":"bold"});
				rowDom.append(dom);
				$("#"+container).prepend(rowDom);
	   }
	   if(i%16==0)
	   {
	      
	       
	       
		   rowDom=$("<div style='position:relative;clear:both'></div>");
		     dom=$("<div>"+String.fromCharCode(64+row)+"</div>");
	        dom.css({"position":"absolute","line-height":"3","left":"-16px","top":"4px","width":"32px","height":"18px","font-weight":"bold"});
			rowDom.append(dom);
	        
			
	   }
	   
	   var dom=$("<div id='"+container+"_cell_"+i+"'><span class='l'></span><span class='r'>"+(i+1)+"</span></div>");
	   dom.addClass("pin_cell");
	   rowDom.append(dom);

	}
	$("#"+container).prepend(rowDom);

	 $("#"+container).append($("<br style='clear:both'/>"));
	 rowDom=$("<div></div>");
    for(var i=1;i<=16;i++)
	{
	   var dom=$("<div>"+i+"</div>");
	   dom.css({"float":"left","width":"6.25%","height":"18px","font-weight":"bold","text-align":"center"});
	   rowDom.append(dom);
	}
	$("#"+container).prepend(rowDom);
}

//*******绘画电池托盘 end**********************************************************************************

function draw_tray256_small(container)
{
	var rowDom=$("<div></div>");
    for(var i=1;i<=16;i++)
	{
	   var dom=$("<div>"+i+"</div>");
	   dom.css({"float":"left","width":"6.25%","height":"18px","font-weight":"bold","text-align":"center"});
	   rowDom.append(dom);
	}
	$("#"+container).append(rowDom);
    rowDom=$("<div style='position:relative;clear:both'></div>");
    for(var i=0;i<256;i++)
	{
		var row=i/16+1;
		var dom;
		if(i%16==15)
	   {
                dom=$("<div>"+String.fromCharCode(64+row)+"</div>");
		        dom.css({"position":"absolute","line-height":"3","right":"-38px","top":"0px","width":"32px","height":"8px","font-weight":"bold"});
				rowDom.append(dom);
				$("#"+container).prepend(rowDom);
	   }
	   if(i%16==0)
	   {
	      
	       
	       
		   rowDom=$("<div style='position:relative;clear:both'></div>");
		     dom=$("<div>"+String.fromCharCode(64+row)+"</div>");
	        dom.css({"position":"absolute","line-height":"3","left":"-16px","top":"0px","width":"32px","height":"18px","font-weight":"bold"});
			rowDom.append(dom);
	        
			
	   }
	   
	   var dom=$("<div id='"+container+"_cell_"+i+"'><span class='l'></span></div>");
	   dom.addClass("pin_cell_small");
	   rowDom.append(dom);

	}
	$("#"+container).prepend(rowDom);

	 $("#"+container).append($("<br style='clear:both'/>"));
	 rowDom=$("<div></div>");
    for(var i=1;i<=16;i++)
	{
	   var dom=$("<div>"+i+"</div>");
	   dom.css({"float":"left","width":"6.25%","height":"18px","font-weight":"bold","text-align":"center"});
	   rowDom.append(dom);
	}
	$("#"+container).prepend(rowDom);
}

 